package com.cjq.service;

import com.cjq.mapper.UsersssmMapper;
import com.cjq.pojo.Usersssm;
import com.cjq.pojo.UsersssmExample;
import com.cjq.vo.QueryVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {
    @Resource
    private UsersssmMapper usersssmMapper;

    //根据传进来的用户名和密码在userssm表进行验证
    @Transactional(propagation = Propagation.REQUIRED, readOnly = true)
    public int loginUser(String loginname, String password) {
        QueryVO vo = new QueryVO(loginname, password);
        Usersssm usersssm = usersssmMapper.selectByPrimaryKey(vo);
        int a= 0;
        if (usersssm!=null) {
            a=1;
        }
        return a;


    }
}
